<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>后台数据信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="shortcut icon" type="image/x-icon" href="https://wwl.ycws.cc/image/backgroundimage/e.ico">
	<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
	<script src="js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
	function exit(){
		window.open("<%=path %>/Exit/ExitSystem","_self");
	}
	function add(){
		 window.location.href="selectPhone.jsp"; 
	}
	</script>
	<script type="text/javascript">
		var page=0;//获取当前默认值
		//下一页      
		function nextpage(){
			var phone=$("#phone").val();
			var name=$("#name").val();
			name=encodeURI(encodeURI(name));
			var totalPage=$("#span_total").html();//获取总页数
			page=$("#span_page").html();	
			page=(page++)%totalPage;	
			window.open("<%=path%>/pc/selectYnameOrYphone?pageCurrent="+page+"&phone="+phone+"&name="+name,"_self");
		}
		//上一页
		function forwardpage(){
			var phone=$("#phone").val();
			var name=$("#name").val();
			name=encodeURI(encodeURI(name));
			var totalPage=$("#span_total").html();//获取总页数
			page=$("#span_page").html()-1;
			--page;
			if(page<0) page=totalPage-1;
			window.open("<%=path%>/pc/selectYnameOrYphone?pageCurrent="+page+"&phone="+phone+"&name="+name,"_self");
		}
		//首页
		function firstpage(){
			var phone=$("#phone").val();
			var name=$("#name").val();
			name=encodeURI(encodeURI(name));
			page=0;
			window.open("<%=path%>/pc/selectYnameOrYphone?pageCurrent="+page+"&phone="+phone+"&name="+name,"_self");
		}
		//末页
		function lastpage(){
			var phone=$("#phone").val();
			var name=$("#name").val();
			name=encodeURI(encodeURI(name));
			page=$("#span_total").html()-1;//获取总页数
			window.open("<%=path%>/pc/selectYnameOrYphone?pageCurrent="+page+"&phone="+phone+"&name="+name,"_self");
		}
	
	</script>
  </head>
  <body>
  	<c:if test="${result==1}">
	<div style="text-align: center;">
  	</div>
  	<form action="<%=path%>/pc/selectYnameOrYphone?pageCurrent=0" method="post">
    <table border="0" cellpadding="0" cellspacing="0" align="center">
    	<tr height="50">
    		<td align="center">
    			<!-- <a href="add.jsp"></a> -->
    			<input type="button" onclick="add()" value="添加" style="width: 100px; height: 40px; font-size:20px; color:white; background-color:47A7FA;">
    		</td>
    		<td align="right" colspan="10">
    			姓名:<input type="text"  name="name" style="width: 150px; height: 40px; "/>
    			手机:<input type="text"  name="phone" style="width: 150px;  height: 40px;"/>
    		</td>
    		<td align="center">
    			<input type="submit" value="搜索" style="height: 40px; width:100px; color: white; font-size:20px; background-color:47A7FA;" >
    			
    		</td>
    		<td align="right">
    			<input type="button" onclick="exit()" value="退出登录" style="width: 120px; color:white; height: 40px; font-size:20px; background-color:C53320;">
    		</td>
    	</tr>
    
    
    	<tr align="center" height="50" style="background-color:2082D5; color:white;">
    		<td width="100">id</td>
    		<td colspan="3">图片</td>
    		<td width="100">姓名</td>
    		<td width="100">性别</td>
    		<td width="100">户主关系</td>
    		<td width="100">联系方式</td>
    		<td width="100">小区名称</td>
    		<td width="100">单元/楼/室</td>
    		<td width="100">是否付款</td>
    		<td width="100">注册时间</td>
    		<!--  <td width="50">更改时间</td>
    		<td width="50">业主标示符</td>-->
    		<td width="200">操作</td>
    	</tr>
    	
    	
    	<c:forEach var="v" items="${uploadfiles}">
	    	<tr align="center">
	    			<td>${v.yid}</td>
	    			<td><img alt="" src="${v.yfilename}" width="100" height="100"></td>
	    			<td><img alt="" src="${v.yfilename1}" width="100" height="100"></td>
	    			<td><img alt="" src="${v.yfilename2}" width="100" height="100"></td>
	    			<td>${v.yname}</td>
	    			<td>${v.ysex}</td>
	    			<td>${v.yowner}</td>
	    			<td>${v.yphone}</td>
	    			<td>${v.yaddress}</td>
	    			<td>${v.ydetailed}</td>
	    			
	    			<td>
	    				<c:if test="${fn:contains(v.yindex,'0') }">
        					未付款
        				</c:if>
        				<c:if test="${fn:contains(v.yindex,'1') }">
        					已支付
        				</c:if>
	    			</td>
	    			<td>${v.createtime}</td>
	    			<!--  <td>${v.updatetime}</td>
	    			<td>${v.ynumber}</td>-->
	    			<td>
	    				<a href="<%=path%>/pc/details?id=${v.yid}" style="text-decoration: none; background-color:2082D5; color:white; font-size: 20px;">详情</a>
	    				<a href="<%=path%>/pc/get_id?id=${v.yid}" style="text-decoration: none; background:url(images/update.png) no-repeat; color: white; font-size: 20px;">修改</a>
	    				<a href="<%=path%>/pc/delete_id?id=${v.yid}" style="text-decoration:none; background-color:C53320; color: white; font-size: 20px;">删除</a>
	    			</td>
	    	</tr>
	    	
    	</c:forEach>
    	<c:if test="${pageTotal!=0}">
    		<tr align="right" height="50px;">
	    		<td colspan="15" >
			 		<a href="javascript:firstpage()" style="text-decoration: none;   padding: 10px; color: black;">首页</a>|
			 		<a href="javascript:forwardpage()" style="text-decoration:none;  padding: 10px; color: black;">上一页</a>|
			 		<a href="javascript:nextpage()" style="text-decoration:none; 	padding: 10px; color: black;">下一页</a>|
			 		<a href="javascript:lastpage()" style="text-decoration:none;  	padding: 10px; color: black;">末页</a>
			 		&nbsp;&nbsp;&nbsp;&nbsp;第<label id="span_page">${pageCurrent}</label>页/共<label id="span_total" >${pageTotal}</label>页
			 	</td>	 		
	    	</tr>
	    </c:if>
	    
	    <c:if test="${pageTotal==0}">
	    		<td colspan="15" align="right">
			 		<font style="font-size: 20px;">没有数据</font>
			 	</td>	 	
	    </c:if>
    </table>
    </form>
    <input type="hidden" id="name" value="${name}">
    <input type="hidden" id="phone" value="${phone}">
    
    <input type="hidden" value="${userid}">
    
    </c:if>
    <c:if test="${empty result}">
  		<a href="login.jsp">请登录</a>
  	</c:if>
  </body>
</html>
